<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../css/global.css" media="all">
    <link rel="stylesheet" href="../css/table.css" />
  </head>
  <body>
    <div class="admin-main">
        <div style="width: 200px;">
          <input type="text" id="treeselecttest"  lay-filter="demo" placeholder="模块" autocomplete="off" class="layui-input">
        </div>
        <div>
            控件赋值后重新渲染
            <br/>
            <pre class="layui-code">
            //全部treeselect
            treeselect.render();
            //支持filter筛选
            treeselect.render({filter:'demo'});
            </pre> 
        </div>
        <div>
           参数：<br/>
           filter：当filter不为空或者options为空时，为重新渲染模式<br/>
           elem：控件ID（#）获取className（.）<br/>
           data：树形数据或者获取树形数据的URL地址<br/>
           method：当data为url时，ajax的请求方式<br/>
        </div>
    </div>
  <script type="text/javascript" src="../plugins/layui/layui.js"></script>
  <script>
      layui.config({
        base: '../extend/'
      });
      layui.use('treeselect',
        function () {
            treeselect = layui.treeselect;
            treeselect.render({
                elem: "#treeselecttest",
                data: "../datas/treeSelect.json",
                method: "GET"
            });
        }
      );
    </script>
  </body>
</html>
